<template>
	<!-- 申请退款 -->
	<view class="form-container">
		<nt-order-detail :orderInfo="commonForm.orderInfo"></nt-order-detail>
		<nt-card label="申请转单">
			<view class="form-item vertical">
				<!-- <view class="form-item__label">修改内容：</view> -->
				<view class="form-item__content">
					<text style="color:#999">示例：</text>{{commonForm.formConfig.smsnoticeContent}}

				</view>
				<view class="form-item__content" style="margin-top:15rpx">
					<text style="color:#999">温馨提示：</text> {{commonForm.formConfig.smsnoticeTips}}
				</view>
			</view>
			<nt-button text="发送短信" @tap="submit"></nt-button>
		</nt-card>
	</view>
</template>

<script>
	import {
		postSmsnotice
	} from "@/api"
	export default {
		data() {
			return {
				formData: {
					remarks: "",
					images: []
				},
				loading: false
			}
		},
		inject: ["commonForm"],
		methods: {
			// 提交转单申请
			submit() {
				if (this.loading) return
				this.loading = true
				postSmsnotice({
					realorder_id: this.commonForm.options.id,
				}).then(res => {
					const {
						code
					} = res;
					if (code === 1) {
						this.toast("短信已发送")
						setTimeout(() => {
							this.back()
							uni.$emit('changeList')
						}, 1000)
					}
				}).finally(() => {
					this.loading = false
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import "./style.scss";

	/deep/ .button-container {
		margin-top: 60rpx;
	}
</style>